package com.Prototype;

import java.util.Hashtable;

public class MyFruitStore {
    private static Hashtable fruitTable = null;
    private static MyFruitStore fruitStore;
    private MyFruitStore(){
        fruitTable = new Hashtable<Integer,MyFruit>();
    }
    public static MyFruitStore Getfruitstore(){
        if(fruitStore == null){
            fruitStore = new MyFruitStore();
        }
        return fruitStore;
    }
    public void Add(Integer key,MyFruit fruit){
            fruitTable.put(key,fruit);
    }

    public MyFruit Get(Integer key){
        MyFruit fruit = (MyFruit) fruitTable.get(key);
        return (MyFruit) fruit.clone();
    }


}
